//
//  BasicInfo.swift
//  XCDragCardContainer
//  Created by XC on 2023/3/1.
//
//
//

import Foundation
import QuartzCore

public struct BasicInfo {
    public let translation: CGPoint
    public let scale: CGFloat
    public let rotationAngle: CGFloat
    
    public var transform: CGAffineTransform {
        let transform = CGAffineTransform(translationX: translation.x, y: translation.y)
        return transform.rotated(by: rotationAngle).scaledBy(x: scale, y: scale)
    }
    
    public init(translation: CGPoint, scale: CGFloat, rotationAngle: CGFloat) {
        self.translation = translation
        self.scale = scale
        self.rotationAngle = rotationAngle
    }
    
    public static let `default` = BasicInfo(translation: .zero, scale: 1, rotationAngle: 0)
}
